package com.health.mapper;

import com.health.entity.Hospital;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.health.entity.pojo.vo.HospitalVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 * 医院表 Mapper 接口
 * </p>
 *
 * @author sanchuan
 * @since 2023-04-16
 */
public interface HospitalMapper extends BaseMapper<Hospital> {

    @Update("UPDATE hospital SET is_shelves = #{isShelves} WHERE id = #{id}")
    Boolean changeHospitalShelves(@Param("isShelves") boolean isShelves, @Param("id") Integer id);


    Boolean changeHospitalShelvesMulti(@Param("isShelves") boolean isShelves, @Param("ids") List<Integer> ids);

    Boolean deleteHospitalShelvesMulti(List<Integer> ids);

    @Select("select id,name from hospital where is_deleted = 0 and is_shelves = 1")
    List<HospitalVO> getHospitals();
}
